// ============================== 导入依赖 ============================== //

import * as echarts from 'echarts'

const COLOR = [
  new echarts.graphic.LinearGradient(0, 0, 0, 1, [
    { offset: 0, color: '#76E1AE' },
    { offset: 1, color: '#00B07E' },
  ]),
  new echarts.graphic.LinearGradient(0, 0, 0, 1, [
    { offset: 0, color: '#C0D9FF' },
    { offset: 1, color: '#409EFF' },
  ]),
  new echarts.graphic.LinearGradient(0, 0, 0, 1, [
    { offset: 0, color: '#57ECF8' },
    { offset: 1, color: '#49C1F5' },
  ]),
]

// ============================== 导出配置 ============================== //

export default {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow',
    },
  },
  xAxis: {
    data: [],
    axisTick: {
      show: false,
    },
    axisLabel: {
      interval: 0,
    },
  },
  yAxis: {
    minInterval: 1,
    axisLine: {
      show: false,
    },
    axisTick: {
      show: false,
    },
    axisLabel: {
      color: '#666',
    },
  },
  grid: {
    top: 50,
    left: 10,
    right: 10,
    bottom: 0,
    containLabel: true,
  },
  legend: {
    top: 0,
    left: 'center',
    icon: 'circle',
  },
  series: COLOR.map((color) => ({
    type: 'bar',
    barWidth: 14,
    label: {
      show: true,
      position: [2, -4],
      rotate: 90,
    },
    itemStyle: {
      color,
    },
    data: [],
  })),
}
